<?php  
class ControllerModuleArticleShoutbox extends Controller {
	protected function index($setting) {
	if($this->config->get('config_news_installed')==1){
		$this->document->addStyle('catalog/view/javascript/news/shoutbox.css');
		static $module = 0;
		$this->language->load('module/article_shoutbox'); 
		
		$this->data['heading_title']	= $this->language->get('heading_title');
		//Entry
		$this->data['entry_your_name']	= $this->language->get('entry_your_name');
		$this->data['entry_message']	= $this->language->get('entry_message');
		$this->data['entry_captcha']	= $this->language->get('entry_captcha');
		
		$this->data['text_please_login'] = sprintf($this->language->get('please_login'), $this->url->link('account/login', '', 'SSL'));
		$this->data['text_wait']	= $this->language->get('text_wait');
		$this->data['text_on']	= $this->language->get('text_on');
		$this->data['text_clear_message']	= $this->language->get('text_clear_message');
		
		$this->data['text_reload_captcha'] = $this->language->get('text_reload_captcha');
		$this->data['error_message']	= $this->language->get('error_message');
		$this->data['button_post_message']	= $this->language->get('button_post_message');
		$this->data['text_all']	= $this->language->get('text_all');
		$this->data['text_online']	= $this->language->get('text_online');
		
		$this->data['reload_time']=$this->config->get('article_shoutbox_reload_time')*1000;
		$this->data['config_captcha']=$this->config->get('article_shoutbox_captcha');
		$this->data['config_login']=$this->config->get('article_shoutbox_login');
		$this->data['logged'] = $this->customer->isLogged();
		
		/*User*/ 
		$this->load->library('user');
		$this->user = new User($this->registry);
			
		$this->data['user_logged']= $this->user->isLogged();
		$this->data['user_name'] = $this->user->getUserName();
		$this->data['user_message'] = $this->language->get('text_user_message');
		/*Customer*/ 
		if ($this->customer->isLogged()) {
      		$this->data['name'] = $this->customer->getFirstName();
    	} else {
			$this->data['name'] = '';
		}
		
		$this->data['module'] = $module++;
						
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/blog/article_shoutbox.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/module/blog/article_shoutbox.tpl';
		} else {
			$this->template = 'default/template/module/blog/article_shoutbox.tpl';
		}
		
		$this->render();
		}
	}
}
?>